﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RecursoGrid.ascx.cs" Inherits="UILGestion.Control.RecursoGrid" %>
<%@ Register Assembly="CustomControls" Namespace="CustomControls" TagPrefix="cc1" %>
<link href="../css/main.css" rel="stylesheet" type="text/css" />
<script src="../Scripts/controlGrid.js" type="text/javascript"></script>
 <script type="text/javascript">
     function SelectAll(frm, id) {

         var frm = document.getElementById("itemPlaceHolderContainer");
         for (i = 1; i < frm.rows.length; i++) {
             var checkbox = frm.rows[i].cells[0].childNodes[1];
             if (checkbox != null)
                 checkbox.checked = document.getElementById(id).checked;
         }
     };
    </script>
<asp:DataPager ID="pager" PagedControlID="ListView1" runat="server">
    <Fields>
      <cc1:PagerField NextPageImageUrl="~/Images/arrow_right2.gif" PreviousPageImageUrl="~/images/arrow_left.gif" />
    </Fields>
</asp:DataPager>
<asp:ListView ID="ListView1" runat="server" OnDataBound="ListView1_DataBound"  ClientIDMode="Static"
    DataKeyNames="idInternal" onitemdatabound="ListView1_ItemDataBound">
    <LayoutTemplate>
        <table id="itemPlaceHolderContainer" border="0" runat="server" class="yui-grid">
            <tr id="Tr1" runat="server">
             <th>
            
           <asp:CheckBox runat="server" ID="chkSelectAll" ClientIDMode="Static" onclick="SelectAll('ListView1','chkSelectAll')" />
            </th>
                <th id="Th1" runat="server">
     
                    <asp:LinkButton ID="lb2" CommandName="Sort" CommandArgument="codPartida" runat="server">Cod Partida</asp:LinkButton>
                </th>
                <th id="Th3" runat="server">
                    <asp:LinkButton ID="lb3" CommandName="Sort" CommandArgument="desPartida" runat="server">Des Partida</asp:LinkButton>
                </th>
                <th id="Th5" runat="server">
                    <asp:LinkButton ID="LinkButton3" CommandName="Sort" CommandArgument="codigo" runat="server">Codigo</asp:LinkButton>
                </th>
                <th id="Th2" runat="server">
                    <asp:LinkButton ID="LinkButton1" CommandName="Sort" CommandArgument="descripcion" runat="server">Descripcion Recurso</asp:LinkButton>
                </th>
                <th id="Th4" runat="server">
                    <asp:LinkButton ID="LinkButton2" CommandName="Sort" CommandArgument="unidad" runat="server">Unidad</asp:LinkButton>
                </th>
                <th id="Th6" runat="server">
                    <asp:LinkButton ID="LinkButton4" CommandName="Sort" CommandArgument="cantidad" runat="server">Cantidad</asp:LinkButton>
                </th>

                <th id="Th7" runat="server">
                    <asp:LinkButton ID="LinkButton5" CommandName="Sort" CommandArgument="precioMon" runat="server">Precio</asp:LinkButton>
                </th>

                 <th id="Th8" runat="server">
                    <asp:LinkButton ID="LinkButton6" CommandName="Sort" CommandArgument="parcialMon" runat="server">Parcial</asp:LinkButton>
                </th>

                 <th id="Th9" runat="server">
                    <asp:LinkButton ID="LinkButton7" CommandName="Sort" CommandArgument="parcialDispMon" runat="server">Disponible</asp:LinkButton>
                </th>
                              
                
            </tr>
            <tr id="itemPlaceholder" runat="server">
            </tr>
        </table>



    </LayoutTemplate>
    <ItemTemplate>
        <tr style='background-color: <%# (Container.DataItemIndex % 2 == 0)?"#eee":"#fff" %>'>
            <td>
         
             <asp:CheckBox runat="server" ID="chkEmployeeSelector"  />
         
                
            </td>
            <td >
                    <%# Eval("codPartida")%> 
            </td>
            <td >
                    <%# Eval("desPartida")%>
            </td>
             <td>
                <%# Eval("codigo")%>
            </td>
            
            <td align="left">
            <%# Eval("descripcion")%>
                 
            </td>
          
            <td>
                <%# Eval("unidad") %>
               
               
            </td>
             <td align="right">
                <%# Eval("cantidad")%>
               
               
            </td>
             <td align="right">
                <%# Eval("precioMon")%>
               
               
            </td>
            <td align="right">
                <%# Eval("parcialMon")%>
               
               
            </td>
             <td align="right">
                <%# Eval("parcialDispMon")%>
               
               
            </td>
            <%--<td>
                <asp:HyperLink ID="AddressLink" runat="server" Target="_blank" NavigateUrl='<%# "http://www.google.com/maps?q=" + Eval("Address") + ",+" + Eval("CityStateZip") %>'
                    Text='<%# Eval("Address") %>'></asp:HyperLink>
                <br />
                <%# Eval("CityStateZip") %>
            </td>--%>
            <%--<td>
                <asp:Repeater ID="Phones" runat="server" DataSource='<%# Eval("Phones") %>'>
                    <ItemTemplate>
                        <%# Container.DataItem %><br />
                    </ItemTemplate>
                </asp:Repeater>
                <cc1:EmailHyperlink ID="EmailLink" runat="server" Text='<%# Eval("Email") %>' Email='<%# Eval("Email") %>'
                    Name='<%# Eval("Name") %>'></cc1:EmailHyperlink>
            </td>--%>
            
           <%-- <td>
                <asp:HyperLink ID="HyperLink1" runat="server" 
                    ToolTip="Add to/Remove from Active Tag"><%# (bool)Eval("HasTag") ? "Remove" : "Add" %></asp:HyperLink>
            </td>--%>
        </tr>
    </ItemTemplate>
    <EmptyDataTemplate>
        <table id="Table1" runat="server" style="">
            <tr>
                <td>
                    <h2 style="color: Red ; font-size:small">
                  
                        No existe Informacion.</h2>
                </td>
            </tr>
        </table>
    </EmptyDataTemplate>
</asp:ListView>





    
     